package edu.polsl.bio.str.node.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.WebApplicationContext;

import javax.servlet.ServletContextEvent;

/**
 * //todo class description
 * <p/>
 * Created on: Jun 12, 2011 4:30:49 PM <br/>
 * <a href="http://www.polsl.pl">www.polsl.pl</a>
 *
 * @author lukasz.olczak@polsl.pl
 */
public class ContextLoaderListenerExt extends ContextLoaderListener {
  /**
   * slf4j Logger.
   */
  private static final Logger log = LoggerFactory.getLogger(ContextLoaderListenerExt.class.getName());

  @Override
  public void contextInitialized(ServletContextEvent event) {
    super.contextInitialized(event);    //To change body of overridden methods use File | Settings | File Templates.
    WebApplicationContext context = (WebApplicationContext) event.getServletContext().getAttribute(
        WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
    context.publishEvent(new WebContextInitializationFinishedEvent(this));

  }
}
